<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
        .wrap{
            display: flex;
            justify-content: space-around;
        }
        .wrap div{
            flex: 1;
            text-align: center;
            line-height: 50px;
        }
        img{
            width: 20px;
        }
    </style>
</head>
<body>
    <div id="box">
      
        <navbar>
            <template #left>
                <div>
                    <span>&lt;</span>
                    <span>返回</span>
                </div>
            </template>
            <template  #center>
                <div>
                    <span>首页</span>
                </div>
            </template>  
            <template  #right>
                <div>
                    <img src="images/search.png" alt="">
                </div>
            </template>
        </navbar>
    </div>
    <script>
        Vue.component("navbar",{
            template:`
                <div class="wrap">
                   <slot name="left"></slot>
                   <slot name="center"></slot>
                   <slot name="right"></slot>
                </div>
            `
        })
        const vm = new Vue({
            el:"#box",
            data:{
                isShow:true
            }
        })
    </script>
</body>
</html>